.. include:: /Includes.rst.txt .. _period-registration-viewhelper: ================================= ViewHelper for your own extension ================================= You are using reserve for your ticket registrations and want to combine that with some other extensions like news or events2? Then try out the PeriodRegistrationViewHelper. This ViewHelper allows you to render remaining participants of one or more periods and can provide a link to the registration form. Example usage ------------- It can look like this: .. figure:: ../../Images/PeriodRegistrationViewHelper.png :class: with-shadow :alt: Example screenshot :width: 500px All you need to do is using the ViewHelper in your own Fluid template. Lets try it out: .. code-block:: html

Remaining participants: {period.remainingParticipants}

Get a ticket!
Show all periods
Could not find any period for given time.
You can completely customize the output of this ViewHelper. The Variable ``{periods}`` will be added and contains all matching periods (``\JWeiland\Reserve\Domain\Model\Period[]``). It's an array so either use a foreach or ``{periods.0}`` if you have just one period. Extended example ================ Can I render some more information? Of course you can! You can use the whole ``\JWeiland\Reserve\Domain\Model\Period`` model with all its relations. Here is a an extended example that uses some more functionality of the Period model: .. figure:: ../../Images/PeriodRegistrationViewHelperExtreme.png :class: with-shadow :alt: Example screenshot :width: 500px .. code-block:: html

{period.facility.name}

Date {period.date}
Begins at {period.begin}
Ends at {period.end}Open end

Remaining participants: {period.remainingParticipants}

Already {period.countActiveReservations} reservations!

Get a ticket!
Show all periods
Could not find any period for given time.